﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DARE
{
    public class CContainerData : CComponentData
    {
        //public CContainer container;
        public uint referenceGameObjectID;

        public override void FillDataStructure(object component)
        {
            base.FillDataStructure(component);
            referenceGameObjectID = (component as CContainer).ReferenceGameObject.ID;
            //container = component as CContainer;
        }

        //public override void FillFromDataStructure(ref CComponent component, CRender3D render, CHUDSystem hud)
        //{
        //    base.FillFromDataStructure(ref component, render, hud);
        //    if (component.GameObject.Mgr != null)
        //        (component as CContainer).ReferenceGameObject = component.GameObject.Mgr.FindInstance(referenceGameObjectID);
        //}


        public override void FillFromDataStructure(ref CComponent component, CRender3D render, CHUDSystem hud)
        {
            base.FillFromDataStructure(ref component, render, hud);
            if (component.GameObject.Mgr != null)
                (component as CContainer).ReferenceGameObject = component.GameObject.Mgr.FindInstance(referenceGameObjectID);
        }
    }
}
